home *** CD-ROM | disk | FTP | other *** search
/ Invisible Universe / Invisible Universe (1995)(Voyager)[Mac-PC].iso / mac / MOVIES / MOVIES.DIR / 00050_Script_50 < prev    next >
Text File  |  1995-11-15  |  4KB  |  178 lines

  1. on idle
  2.   showHilite
  3.   --goMovieGo
  4.   pass
  5. end idle
  6.  
  7. on exitFrame
  8.   go to the frame
  9. end
  10.  
  11. on patchpal
  12.   global gMovFixpal
  13.   if the machineType <> 256 then gMovFixpal(mPatchIt)
  14. end patchpal
  15.  
  16. on startMovie
  17.   global gCom
  18.   set gCom = 0
  19.   
  20.   setLocalVariables
  21.   buildMovieButtons
  22.   buildMovieList
  23.   newMovie
  24. end startMovie
  25.  
  26. on newMovie
  27.   global gMovieLabel, gPageIndex, gRandomMovies, gMovieList, gRanMovieIndex
  28.   global gMovieTimeCO, gMovieTimeCR, gMovieTimeFO, gMovieTimeSP
  29.   
  30.   if the frame > 1 and the frameLabel <> "" then set gMovieLabel = the frameLabel
  31.   
  32.   if voidP(gMovieLabel) then put "cos" into gMovieLabel
  33.   
  34.   if gMovieLabel = "O" then
  35.     set gRandomMovies = 1   
  36.     set gMovieList = ["cos", "CRS", "FOS", "SPS"]
  37.     repeat with i = 1 to 16
  38.       set rNum = random(3)
  39.       set a = getAt(gMovieList, rNum)  
  40.       deleteAt(gMovieList, rNum)
  41.       add(gMovieList, a)
  42.     end repeat
  43.     set gRanMovieIndex = 1
  44.     set gMovieLabel = getAt(gMovieList, gRanMovieIndex)
  45.   else
  46.     set gRandomMovies = 0
  47.   end if
  48.   
  49.   go frame (label(gMovieLabel)-1)
  50.   puppetTransition 50,1,120,false
  51.   go next
  52.   patchpal
  53.   --addToRetrace
  54.   put 0 into gPageIndex
  55.   updateStage
  56.   
  57.   set movieTime = 0
  58.   do "set movieTime = gMovieTime"&char 1 to 2 of gMovieLabel
  59.   
  60.   if movieTime > 0 then continue
  61.   
  62.   if gRandomMovies then playMovie
  63.   
  64. end newMovie
  65.  
  66. on stopMovie
  67.   global gMovFixpal
  68.   set the visible of sprite 9 to true
  69.   set the visible of sprite 10 to true
  70.   --if the machineType <> 256 then gMovFixpal(mDispose)
  71.   --closeXlib "FixPalette XObj"
  72.   puppetSprite 15, 0
  73.   updateStage
  74.   unload
  75. end stopMovie
  76.  
  77. on setLocalVariables
  78.   global gMovieIsPlaying, gRetraceNames, gVolume
  79.   global gCurrChan,gFirsChan,gLastChan,gPrevHilite,gMovFixpal
  80.   if voidP(gRetraceNames) then put empty into gRetraceNames
  81.   --if voidP(gVolume) then put 7 into gVolume
  82.   put false into gMovieIsPlaying
  83.   set the visible of sprite 9 to false
  84.   set the visible of sprite 10 to false
  85.   if the machineType <> 256 then
  86.     openxlib "FixPalette XObj"
  87.     set gMovFixpal=FixPalette(mNew, the stageLeft, the stageTop, the stageRight, the stageTop)
  88.   end if
  89.   put 0 into gPrevHilite
  90.   put 2 into gCurrChan
  91.   put 2 into gFirsChan
  92.   put 11 into gLastChan
  93. end setLocalVariables
  94.  
  95. on addToRetracexxxx
  96.   global gMovieList,gRetraceNames,gLastRetraceName
  97.   global gRetraceLabels, gMovieLabel, gPageIndex
  98.   put the frameLabel into gMovieLabel
  99.   put [] into it
  100.   do "put findpos(gMovieList,#"&gMovieLabel&") into it"
  101.   put getAt(getAt(gMovieList,it),1) into retraceName
  102.   if gLastRetraceName = retraceName then exit
  103.   put the number of lines in gRetraceNames into nr
  104.   put gLastRetraceName into line(nr+1) of gRetraceNames
  105.   put gMovieLabel into line(nr+1) of gRetraceLabels
  106.   if nr = 15 then
  107.     delete line 1 of gRetraceNames
  108.     delete line 1 of gRetraceLabels
  109.     put retraceName into gLastRetraceName
  110.   end if
  111. end addToRetrace
  112.  
  113. on getDescr N
  114.   --  searches the data in the list for the product then returns the description
  115.   --  you could make similar handlers for other values in the property lists.
  116.   global Data
  117.   if not listP(Data) then set Data = value(field "data")
  118.   repeat with P in Data
  119.     if the Prod of P = N then return ( the Desc of P )
  120.   end repeat
  121. end
  122.  
  123. on delay howLong
  124.   startTimer
  125.   repeat while the timer < howLong
  126.   end repeat
  127. end delay
  128.  
  129. on retraceLocal
  130.   global gMovieIsPlaying
  131.   
  132.   set m = the movie
  133.   set f = the frame
  134.   
  135.   if gMovieIsPlaying then 
  136.     cursor 4
  137.     set pausedMovie = 1
  138.     
  139.     pauseMovie 1
  140.     cursor -1
  141.   end if
  142.   
  143.   retrace
  144.   
  145.   if the movie = m then      
  146.     if f = the frame then    
  147.       if pausedMovie then
  148.         playMovie
  149.       end if
  150.     else
  151.       updateStage
  152.       patchpal
  153.     end if
  154.   end if
  155.   
  156. end
  157.  
  158. on doContentsLocal
  159.   global gMovieIsPlaying
  160.   
  161.   if gMovieIsPlaying then 
  162.     cursor 4
  163.     set pausedMovie = 1
  164.     pauseMovie 1
  165.     cursor -1
  166.     set m = the movie
  167.     set f = the frame
  168.   end if
  169.   doContents 
  170.   
  171.   if pausedMovie then 
  172.     if the movie = m and f = the frame then playMovie
  173.   end if
  174.   
  175.   --  go movie "TOC.DIR"
  176.   --  abort
  177. end contents
  178.